﻿using System;
using System.Linq;

namespace BookID.Data
{
    public interface IRepository
    {
        T FirstOrDefault<T>(Func<T, bool> filter) where T : class;

        T Single<T>(Func<T, bool> filter) where T : class;

        IQueryable<T> All<T>() where T : class;

        IQueryable<T> All<T>(params string[] includes) where T : class;

        void Attach<T>(T toBeAttached) where T : class;

        void Add<T>(T toBeAdded) where T : class;

        void Delete<T>(T toBeDeleted) where T : class;

        void Save();
    }
}
